%{
    #include <stdlib.h>
    #include "ExpressionEnsembliste.tab.h"
%}
ident [a-zA-Z]
element [0-9]{1,2}
comp (COMP|comp)
oper2 (UNION|INTER|DIFF|union|inter|diff)
%%
{ident}   { yylval = *yytext - ((*yytext <= 'Z') ? 'A' : 'a'); return IDENT; }
{element} { yylval = atoi(yytext); return ELEM; }
{comp}   return OPER1;

(UNION|union)   { yylval = UNION; return OPER2; }
(INTER|inter)   { yylval = INTER; return OPER2; }
(DIFF|diff)   { yylval = DIFF; return OPER2; }

\n      return END_LINE;
","       return SEPAR;
":="      return AFFECT;
"{"       return START;
"}"       return END;
" "     /* Nothing to do here */
%%
int yywrap() {
    return(1);
}
